#ifndef _DX8_IMAGE_CACHE_H_
#define _DX8_IMAGE_CACHE_H_
#include "graphics/image_cache.h"
#include <D3D8.h>
#include <D3DX8.h>
class DX8ImageCache : public ImageCache
{
public:
				DX8ImageCache();			
	virtual		~DX8ImageCache();

	virtual void		Create(int	Width=1024, int Heigh=1024, int Depth=32);
	virtual void		ClearCache(COLOR c=0xff000000);
	virtual bool		BeginCache();
	virtual void		EndCache();
	virtual void		SetTextureStage(int Stage);
	virtual void		Flush();
	virtual void		Recreate();
protected:
	LPD3DXRENDERTOSURFACE		m_pRenderTarget;
	LPDIRECT3DTEXTURE8			m_pRenderTexture;
	LPDIRECT3DSURFACE8			m_pRenderSurface;

	int					m_CachedOffsetX, m_CachedOffsetY;
};

#endif // _DX8_IMAGE_CACHE_H_